#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int a, b, c;
    while (scanf("%d %d", &a, &b) != EOF)
    {
        int count = 0;
        c = a ^ b;
        while (c)
        {
            c &= c - 1;
            count++;
        }
        printf("%d", count);
    }
    return 0;
}